package com.example.sringboot_web.filter;


import org.springframework.core.annotation.Order;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;


//@WebFilter(urlPatterns = "/myservlet")
public class myfilter1 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("myfilter1初始化》》》》》》》");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("进入myfilter1拦截》》》》》");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("离开myfilter1拦截》》》》》");
    }

    @Override
    public void destroy() {
        System.out.println("myfilter1销毁》》》》》》》");
    }
}
